﻿using System.Collections.Generic;

namespace PhotoGallery.Models
{
    /// <summary>
    /// 获取名称信息结果
    /// </summary>
    public class AlbumsResult
    {
        public AlbumsResult(string name, List<PhotoGallery.Models.PhotoInfoModel> modelPhotos)
        {
            AlbumName = name;
            Photos = new List<Photo>();
            if(modelPhotos != null)
            {
                foreach(var p in modelPhotos)
                {
                    Photos.Add(new Photo(p.Name, p.CDNUrl));
                }
            }
        }

        /// <summary>
        /// 相册名称
        /// </summary>
        public string AlbumName { get; set; }

        /// <summary>
        /// 相册中的照片集合
        /// </summary>
        public List<Photo> Photos { get; set; }

        /// <summary>
        /// 照片
        /// </summary>
        public class Photo
        {
            /// <summary>
            /// 照片
            /// </summary>
            /// <param name="name">照片名称</param>
            /// <param name="url">照片Url</param>
            public Photo(string name,string url)
            {
                PhotoName = name;
                Link = url;
            }

            /// <summary>
            /// 照片名称
            /// </summary>
            public string PhotoName { get; set; }

            /// <summary>
            /// 照片Url
            /// </summary>
            public string Link { get; set; }
        }
    }
}